﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Sharp.DataTransferObject;
using Sharp.Platform.Mvc.Attribute;
using Sharp.Platform.Mvc.Models;

namespace Sharp.WebBooter.Areas.Platform.Models
{
    public class OrgViewModel: BaseViewModel
    {

        public OrgViewModel()
        {
        }
        /// <summary>
        /// Id
        /// </summary>
        public System.Guid Id { get; set; }
        /// <summary>
        /// 上级
        /// </summary>
        [Display(Name = "上级"), DisplayValueField("Title", "Id")]
        public System.Guid? ParentId { get; set; }
 
        public zTreeNode TreeNodes { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        [Display(Name = "编码")]
        public string Code { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        [Display(Name = "排序")]
        public int OrderIndex
        {
            get;
            set;
        }
        /// <summary>
        /// 名称
        /// </summary>
        /// <value>标题</value>
        [Required, Display(Name = "名称")]
        public string Title { get; set; }
        /// <summary>
        /// 简称
        /// </summary>
        public string Abbreviation { get; set; }
        /// <summary>
        /// 层次Id
        /// </summary>
        [Display(Name = "层次"), DisplayValueField("Title", "Id")]
        public Guid? OrgLevelId { get; set; }

        /// <summary>
        /// 编制
        /// </summary>
        [Display(Name = "编制"), RegularExpression(@"^[1-9]\d*$", ErrorMessage = "请输入自然数！")]
        public int? MaxHeadcount { get; set; }

        /// <summary>
        /// 当前编制
        /// </summary>
        [Display(Name = "当前编制")]
        public int? CurrentHeadcount { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        /// <value>备注</value>
        [Display(Name = "备注")]
        public string Remark { get; set; }


        /// <summary>
        /// 层次
        /// </summary>
        public IEnumerable<OrgLevelDTO> OrgLevelList { get; set; }

        /// <summary>
        /// 组织路径
        /// </summary>
        /// <value>The org path.</value>
        public string OrgPath { get; set; }

        /// <summary>
        /// 为控件显示用的属性
        /// </summary>
        /// <![CDATA[<treegrid-@Model.Id treegrid-parent-@Model.ParentId>]]>
        public string Itemclass { get; set; }
        /// <summary>
        /// 父级的文字项
        /// </summary>
        public string ParentText { get; set; }
    }
}